package by.koleda.photoupdater;

import java.util.ArrayList;
import java.util.HashMap;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import by.koleda.photoupdater.manager.ContactsManager;

public class ContactsActivity extends Activity {
	
	private ListView mListView;
	private ContactsAdapter mAdapter;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_contacts);
		ArrayList<HashMap<String, String>> contactsList = new ArrayList<HashMap<String, String>>();
		contactsList = ContactsManager.getContacts();
		
		mListView = (ListView)findViewById(R.id.list_contacts);
		mAdapter = new ContactsAdapter(contactsList);
		mListView.setAdapter(mAdapter);
		
		mListView.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
					long arg3) {
				// TODO Auto-generated method stub
				
			}

        });

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_contacts, menu);
		return true;
	}
 
}
